package test1;

public class LoopDemo {
    public static void main(String[] args) {
        int i = 0;
        int sum = 0;
        while (i < 10) {
            sum = sum + i;
            i++;
        }
        System.out.println("sum="+sum);

        int j = 0;
        int sum1 = 0;
        do {
            sum1 = sum1 + j;
            j++;
        } while (j<10);
        System.out.println("sum1="+sum1);

        int sum2 = 0;
        for (i=0;i<10;i++) {
            sum2 = sum2 + i;
        }
        System.out.println("sum2="+sum2);
    }
}
